package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getMethod("sayHello");
        boolean b = method.isAnnotationPresent(AutoRunMethod.class);
        if (b){
            System.out.println("被标记了");
        }else {
            System.out.println("没有被标记");
        }
    }
}
